#!/usr/bin/sh

rpm -e jenkins #rpm卸载
rpm -ql jenkins #检查是否卸载成功
find / -iname jenkins | xargs -n 1000 rm -rf #彻底删除残留文件

# 导入Yum源：
# .获取jenkins源文件
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repository
# 导入jenkins公钥
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key

# yum安装jenkins
yum install -y jenkins

# 设置开机自启动jenkins:
systemctl enable jenkins